home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / X11 / XCreateFontCursor.z / XCreateFontCursor
Encoding:
Text File  |  2002-10-03  |  9.7 KB  |  198 lines

  1.  
  2.  
  3.  
  4.      XXXXCCCCrrrreeeeaaaatttteeeeFFFFoooonnnnttttCCCCuuuurrrrssssoooorrrr((((3333XXXX11111111))))XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....6666))))XXXXCCCCrrrreeeeaaaatttteeeeFFFFoooonnnnttttCCCCuuuurrrrssssoooorrrr((((3333XXXX11111111))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           XCreateFontCursor, XCreatePixmapCursor, XCreateGlyphCursor -
  10.           create cursors
  11.  
  12.      SSSSYYYYNNNNTTTTAAAAXXXX
  13.           #include <X11/cursorfont.h>
  14.           Cursor XCreateFontCursor(_d_i_s_p_l_a_y, _s_h_a_p_e)
  15.                 Display *_d_i_s_p_l_a_y;
  16.                 unsigned int _s_h_a_p_e;
  17.  
  18.           Cursor XCreatePixmapCursor(_d_i_s_p_l_a_y, _s_o_u_r_c_e, _m_a_s_k,
  19.           _f_o_r_e_g_r_o_u_n_d__c_o_l_o_r, _b_a_c_k_g_r_o_u_n_d__c_o_l_o_r, _x, _y)
  20.                 Display *_d_i_s_p_l_a_y;
  21.                 Pixmap _s_o_u_r_c_e;
  22.                 Pixmap _m_a_s_k;
  23.                 XColor *_f_o_r_e_g_r_o_u_n_d__c_o_l_o_r;
  24.                 XColor *_b_a_c_k_g_r_o_u_n_d__c_o_l_o_r;
  25.                 unsigned int _x, _y;
  26.  
  27.           Cursor XCreateGlyphCursor(_d_i_s_p_l_a_y, _s_o_u_r_c_e__f_o_n_t, _m_a_s_k__f_o_n_t,
  28.           _s_o_u_r_c_e__c_h_a_r, _m_a_s_k__c_h_a_r,
  29.                                      _f_o_r_e_g_r_o_u_n_d__c_o_l_o_r,
  30.           _b_a_c_k_g_r_o_u_n_d__c_o_l_o_r)
  31.                 Display *_d_i_s_p_l_a_y;
  32.                 Font _s_o_u_r_c_e__f_o_n_t, _m_a_s_k__f_o_n_t;
  33.                 unsigned int _s_o_u_r_c_e__c_h_a_r, _m_a_s_k__c_h_a_r;
  34.                 XColor *_f_o_r_e_g_r_o_u_n_d__c_o_l_o_r;
  35.                 XColor *_b_a_c_k_g_r_o_u_n_d__c_o_l_o_r;
  36.  
  37.      AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  38.           _b_a_c_k_g_r_o_u_n_d__c_o_l_o_r
  39.                     Specifies the RGB values for the background of the
  40.                     source.
  41.  
  42.           _d_i_s_p_l_a_y   Specifies the connection to the X server.
  43.  
  44.           _f_o_r_e_g_r_o_u_n_d__c_o_l_o_r
  45.                     Specifies the RGB values for the foreground of the
  46.                     source.
  47.  
  48.           _m_a_s_k      Specifies the cursor's source bits to be displayed
  49.                     or _N_o_n_e.
  50.  
  51.           _m_a_s_k__c_h_a_r Specifies the glyph character for the mask.
  52.  
  53.           _m_a_s_k__f_o_n_t Specifies the font for the mask glyph or _N_o_n_e.
  54.  
  55.           _s_h_a_p_e     Specifies the shape of the cursor.
  56.  
  57.           _s_o_u_r_c_e    Specifies the shape of the source cursor.
  58.  
  59.  
  60.  
  61.      Page 1                                          (printed 10/3/02)
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.      XXXXCCCCrrrreeeeaaaatttteeeeFFFFoooonnnnttttCCCCuuuurrrrssssoooorrrr((((3333XXXX11111111))))XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....6666))))XXXXCCCCrrrreeeeaaaatttteeeeFFFFoooonnnnttttCCCCuuuurrrrssssoooorrrr((((3333XXXX11111111))))
  69.  
  70.  
  71.  
  72.           _s_o_u_r_c_e__c_h_a_r
  73.                     Specifies the character glyph for the source.
  74.  
  75.           _s_o_u_r_c_e__f_o_n_t
  76.                     Specifies the font for the source glyph.
  77.  
  78.           _x
  79.           _y         Specify the x and y coordinates, which indicate
  80.                     the hotspot relative to the source's origin.
  81.  
  82.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  83.           X provides a set of standard cursor shapes in a special font
  84.           named cursor.  Applications are encouraged to use this
  85.           interface for their cursors because the font can be
  86.           customized for the individual display type.  The shape
  87.           argument specifies which glyph of the standard fonts to use.
  88.  
  89.           The hotspot comes from the information stored in the cursor
  90.           font.  The initial colors of a cursor are a black foreground
  91.           and a white background (see _X_R_e_c_o_l_o_r_C_u_r_s_o_r).
  92.  
  93.           _X_C_r_e_a_t_e_F_o_n_t_C_u_r_s_o_r can generate _B_a_d_A_l_l_o_c and _B_a_d_V_a_l_u_e errors.
  94.  
  95.           The _X_C_r_e_a_t_e_P_i_x_m_a_p_C_u_r_s_o_r function creates a cursor and
  96.           returns the cursor ID associated with it.  The foreground
  97.           and background RGB values must be specified using
  98.           foreground_color and background_color, even if the X server
  99.           only has a _S_t_a_t_i_c_G_r_a_y or _G_r_a_y_S_c_a_l_e screen.  The foreground
  100.           color is used for the pixels set to 1 in the source, and the
  101.           background color is used for the pixels set to 0.  Both
  102.           source and mask, if specified, must have depth one (or a
  103.           _B_a_d_M_a_t_c_h error results) but can have any root.  The mask
  104.           argument defines the shape of the cursor.  The pixels set to
  105.           1 in the mask define which source pixels are displayed, and
  106.           the pixels set to 0 define which pixels are ignored.  If no
  107.           mask is given, all pixels of the source are displayed.  The
  108.           mask, if present, must be the same size as the pixmap
  109.           defined by the source argument, or a _B_a_d_M_a_t_c_h error results.
  110.           The hotspot must be a point within the source, or a _B_a_d_M_a_t_c_h
  111.           error results.
  112.  
  113.           The components of the cursor can be transformed arbitrarily
  114.           to meet display limitations.  The pixmaps can be freed
  115.           immediately if no further explicit references to them are to
  116.           be made.  Subsequent drawing in the source or mask pixmap
  117.           has an undefined effect on the cursor.  The X server might
  118.           or might not make a copy of the pixmap.
  119.  
  120.           _X_C_r_e_a_t_e_P_i_x_m_a_p_C_u_r_s_o_r can generate _B_a_d_A_l_l_o_c and _B_a_d_P_i_x_m_a_p
  121.           errors.
  122.  
  123.           The _X_C_r_e_a_t_e_G_l_y_p_h_C_u_r_s_o_r function is similar to
  124.  
  125.  
  126.  
  127.      Page 2                                          (printed 10/3/02)
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.      XXXXCCCCrrrreeeeaaaatttteeeeFFFFoooonnnnttttCCCCuuuurrrrssssoooorrrr((((3333XXXX11111111))))XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....6666))))XXXXCCCCrrrreeeeaaaatttteeeeFFFFoooonnnnttttCCCCuuuurrrrssssoooorrrr((((3333XXXX11111111))))
  135.  
  136.  
  137.  
  138.           _X_C_r_e_a_t_e_P_i_x_m_a_p_C_u_r_s_o_r except that the source and mask bitmaps
  139.           are obtained from the specified font glyphs.  The
  140.           source_char must be a defined glyph in source_font, or a
  141.           _B_a_d_V_a_l_u_e error results.  If mask_font is given, mask_char
  142.           must be a defined glyph in mask_font, or a _B_a_d_V_a_l_u_e error
  143.           results.  The mask_font and character are optional.  The
  144.           origins of the source_char and mask_char (if defined) glyphs
  145.           are positioned coincidently and define the hotspot. The
  146.           source_char and mask_char need not have the same bounding
  147.           box metrics, and there is no restriction on the placement of
  148.           the hotspot relative to the bounding boxes. If no mask_char
  149.           is given, all pixels of the source are displayed.  You can
  150.           free the fonts immediately by calling _X_F_r_e_e_F_o_n_t if no
  151.           further explicit references to them are to be made.
  152.  
  153.           For 2-byte matrix fonts, the 16-bit value should be formed
  154.           with the byte1 member in the most significant byte and the
  155.           byte2 member in the least significant byte.
  156.  
  157.           _X_C_r_e_a_t_e_G_l_y_p_h_C_u_r_s_o_r can generate _B_a_d_A_l_l_o_c, _B_a_d_F_o_n_t, and
  158.           _B_a_d_V_a_l_u_e errors.
  159.  
  160.      DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  161.           _B_a_d_A_l_l_o_c  The server failed to allocate the requested
  162.                     resource or server memory.
  163.  
  164.           _B_a_d_F_o_n_t   A value for a Font or GContext argument does not
  165.                     name a defined Font.
  166.  
  167.           _B_a_d_M_a_t_c_h  Some argument or pair of arguments has the correct
  168.                     type and range but fails to match in some other
  169.                     way required by the request.
  170.  
  171.           _B_a_d_P_i_x_m_a_p A value for a Pixmap argument does not name a
  172.                     defined Pixmap.
  173.  
  174.           _B_a_d_V_a_l_u_e  Some numeric value falls outside the range of
  175.                     values accepted by the request.  Unless a specific
  176.                     range is specified for an argument, the full range
  177.                     defined by the argument's type is accepted.  Any
  178.                     argument defined as a set of alternatives can
  179.                     generate this error.
  180.  
  181.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  182.           XDefineCursor(3X11), XLoadFont(3X11), XRecolorCursor(3X11)
  183.           _X_l_i_b - _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.      Page 3                                          (printed 10/3/02)
  194.  
  195.  
  196.  
  197.